{% import 'Dockerfile/tools.jinja2' as tools %}

{% macro dockerStage() %}
# Staged baselayout builder
FROM webdevops/toolbox AS baselayout
RUN mkdir -p \
        /baselayout/sbin \
        /baselayout/usr/local/bin \
    # Baselayout scripts
    && wget -O /tmp/baselayout-install.sh https://raw.githubusercontent.com/webdevops/Docker-Image-Baselayout/master/install.sh \
    && sh /tmp/baselayout-install.sh /baselayout \
    {{ tools.goreplace(path="/baselayout/usr/local/bin") }} \
    {{ tools.gosu(path="/baselayout/sbin") }}
{% endmacro %}

{% macro copy() %}
# Baselayout copy (from staged image)
COPY --from=baselayout /baselayout /
{% endmacro %}
